package day12.KeJian;

import java.io.FileOutputStream;
import java.io.IOException;

//finally特点
//- 被finally控制的语句一定会执行，除非JVM退出
public class Tset09 {
    public static void main(String[] args) {
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream("D://itheima//nb.txt");
            fos.write("123456".getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (fos!=null){
                try{
                    fos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
